package utils;

import java.util.*;

public class Condition {

    private static ArrayList<String> textList = new ArrayList<String>();//文本集合
    private static ArrayList<String> pictureList = new ArrayList<String>();//图片集合
    private static ArrayList<String> officeList = new ArrayList<String>();//office集合
    private static ArrayList<String> voiceList = new ArrayList<String>();//音频集合
    private static ArrayList<String> videoList = new ArrayList<String>();//视频集合
    private static ArrayList<String> otherList = new ArrayList<String>();//其它集合

    static {

        //文本添加

        textList.add("txt");//txt
        textList.add("docx");//docx
        textList.add("doc");//doc
        textList.add("pdf");//pdf
        textList.add("xls");//xls
        textList.add("xlsx");//xlsx
        textList.add("eml");//eml
        textList.add("rtf");//rtf
        textList.add("csv");//csv

        //图片添加
        pictureList.add("jpg");//jpg
        pictureList.add("png");//png
        pictureList.add("raw");//raw
        pictureList.add("eps");//eps

        //办公添加
        officeList.add("doc");//doc
        officeList.add("docx");//docx
        officeList.add("ppt");//ppt
        officeList.add("pptx");//pptx
        officeList.add("pdf");//pdf
        officeList.add("vsdx");//vsdx
        officeList.add("xls");//xls
        officeList.add("xlsx");//xlsx
        officeList.add("mpp");//mpp
        officeList.add("pub");//pub
        officeList.add("csv");//csv

        //音频添加
        voiceList.add("mp3");//mp3
        voiceList.add("wav");//wav
        voiceList.add("midi");//midi

        //视频添加
        videoList.add("mp4");//mp4
        videoList.add("avi");//avi
        videoList.add("mov");//mov

        //其它添加
        otherList.add("rar");//rar
        otherList.add("zip");//zip
        otherList.add("7z");//7z
        otherList.add("apk");//apk
        otherList.add("jar");//jar
        otherList.add("css");//css
        otherList.add("html");//html
        otherList.add("ttf");//ttf
        otherList.add("null");//null


    }

    public static List<String> getConditionList(String fileType) {
        List<String> conditionList = new LinkedList<String>();
        String[] split = fileType.split(",");
        for (String type:split) {
            switch (type){
                case "text":conditionList.addAll(textList);break;
                case "picture":conditionList.addAll(pictureList);break;
                case "office":conditionList.addAll(officeList);break;
                case "voice":conditionList.addAll(voiceList);break;
                case "video":conditionList.addAll(videoList);break;
                case "other":conditionList.addAll(otherList);break;
            }
        }

        return conditionList;

    }
}
